﻿using System;
using System.ComponentModel.DataAnnotations;
using Viettel.VOFFICE.DAO.Models;

namespace Viettel.VOFFICE.Web.Models
{
    public class NodeUserModel : BaseModel
    {
        public NodeUserModel() { }
        public NodeUserModel(NodeUser nodeUser)
        {
            UserId = nodeUser.UserId;
            NodeId = nodeUser.NodeId;
            FlowId = nodeUser.FlowId;
            MainExecutor = nodeUser.MainExecutor;
            CreatedAt = nodeUser.CreatedAt;
            UpdatedAt = nodeUser.UpdatedAt;
            IsActive = nodeUser.IsActive;
            CreatorId = nodeUser.CreatorId;
        }
        [Required(ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "region")]
        public Guid UserId { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "region")]
        [Range(1, int.MaxValue, ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "region")]
        public int NodeId { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "region")]
        [Range(1, int.MaxValue, ErrorMessageResourceType = typeof(Resources.Resources), ErrorMessageResourceName = "region")]
        public int FlowId { get; set; }

        public bool MainExecutor { get; set; }
        public DateTime CreatedAt { get; set; }
        public DateTime UpdatedAt { get; set; }
        public bool? IsActive { get; set; }
        public Guid? CreatorId { get; set; }

    }
}